# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.ChromeManagement.V1.Model.GoogleChromeManagementV1TelemetryUserDevice do
  @moduledoc """
  Telemetry data collected for a managed user and device. * Granular permission needed: TELEMETRY_API_DEVICE

  ## Attributes

  *   `appReport` (*type:* `list(GoogleApi.ChromeManagement.V1.Model.GoogleChromeManagementV1AppReport.t)`, *default:* `nil`) - Output only. App reports collected periodically sorted in a decreasing order of report_time.
  *   `audioStatusReport` (*type:* `list(GoogleApi.ChromeManagement.V1.Model.GoogleChromeManagementV1AudioStatusReport.t)`, *default:* `nil`) - Output only. Audio reports collected periodically sorted in a decreasing order of report_time.
  *   `deviceActivityReport` (*type:* `list(GoogleApi.ChromeManagement.V1.Model.GoogleChromeManagementV1DeviceActivityReport.t)`, *default:* `nil`) - Output only. Device activity reports collected periodically sorted in a decreasing order of report_time.
  *   `deviceId` (*type:* `String.t`, *default:* `nil`) - The unique Directory API ID of the device. This value is the same as the Admin Console's Directory API ID in the ChromeOS Devices tab.
  *   `networkBandwidthReport` (*type:* `list(GoogleApi.ChromeManagement.V1.Model.GoogleChromeManagementV1NetworkBandwidthReport.t)`, *default:* `nil`) - Output only. Network bandwidth reports collected periodically sorted in a decreasing order of report_time.
  *   `peripheralsReport` (*type:* `list(GoogleApi.ChromeManagement.V1.Model.GoogleChromeManagementV1PeripheralsReport.t)`, *default:* `nil`) - Output only. Peripherals reports collected periodically sorted in a decreasing order of report_time.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :appReport =>
            list(GoogleApi.ChromeManagement.V1.Model.GoogleChromeManagementV1AppReport.t()) | nil,
          :audioStatusReport =>
            list(
              GoogleApi.ChromeManagement.V1.Model.GoogleChromeManagementV1AudioStatusReport.t()
            )
            | nil,
          :deviceActivityReport =>
            list(
              GoogleApi.ChromeManagement.V1.Model.GoogleChromeManagementV1DeviceActivityReport.t()
            )
            | nil,
          :deviceId => String.t() | nil,
          :networkBandwidthReport =>
            list(
              GoogleApi.ChromeManagement.V1.Model.GoogleChromeManagementV1NetworkBandwidthReport.t()
            )
            | nil,
          :peripheralsReport =>
            list(
              GoogleApi.ChromeManagement.V1.Model.GoogleChromeManagementV1PeripheralsReport.t()
            )
            | nil
        }

  field(:appReport,
    as: GoogleApi.ChromeManagement.V1.Model.GoogleChromeManagementV1AppReport,
    type: :list
  )

  field(:audioStatusReport,
    as: GoogleApi.ChromeManagement.V1.Model.GoogleChromeManagementV1AudioStatusReport,
    type: :list
  )

  field(:deviceActivityReport,
    as: GoogleApi.ChromeManagement.V1.Model.GoogleChromeManagementV1DeviceActivityReport,
    type: :list
  )

  field(:deviceId)

  field(:networkBandwidthReport,
    as: GoogleApi.ChromeManagement.V1.Model.GoogleChromeManagementV1NetworkBandwidthReport,
    type: :list
  )

  field(:peripheralsReport,
    as: GoogleApi.ChromeManagement.V1.Model.GoogleChromeManagementV1PeripheralsReport,
    type: :list
  )
end

defimpl Poison.Decoder,
  for: GoogleApi.ChromeManagement.V1.Model.GoogleChromeManagementV1TelemetryUserDevice do
  def decode(value, options) do
    GoogleApi.ChromeManagement.V1.Model.GoogleChromeManagementV1TelemetryUserDevice.decode(
      value,
      options
    )
  end
end

defimpl Poison.Encoder,
  for: GoogleApi.ChromeManagement.V1.Model.GoogleChromeManagementV1TelemetryUserDevice do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
